package com.cxs.xiaomi.utils;

import com.cxs.xiaomi.domain.User;

import javax.servlet.http.HttpServletRequest;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;

/*
 * @Author:cxs
 * @Date:2021/9/14  19:48
 * @Version 1.0
 * @Motto:放下杂念,只为迎接明天更好的自己
 * 数据回显工具类
 * */
public class DatabackUtil {
    public static void dataReback(HttpServletRequest request) {
        Map<String, String[]> map = request.getParameterMap();
        if (map != null) {
            for (Map.Entry<String, String[]> entry : map.entrySet()) {
                String key = entry.getKey();
                String[] value = entry.getValue();
                if (value != null && value.length == 1) {
                    request.setAttribute(key.trim(), value[0]);
                }
            }
        }
    }
}
